/*
User: shy
Date: 2024-04-02 14:53
All rights reserved by Kong Fanqun
*/
<template>
  <div class="chuku_main">
    <!--选择仓库-->
    <div class="sheet_view">
      <van-cell class="sheet_t" title="仓库:"/>
      <div class="sheet_v" @click="show1=true"></div>
      <van-action-sheet v-model:show="show1" :actions="actions" @select="onSelect"/>
    </div>
    <div class="sheet_view">
      <van-cell class="sheet_t" title="客户:"/>
      <div class="sheet_v" @click="show2=true"></div>
      <van-action-sheet v-model:show="show2" :actions="actions" @select="onSelect"/>
    </div>
    <div class="zj_list">
      <div class="test22_class"  ></div>
      <zj_list @getChild="getaaa" :test22="test33"></zj_list>
    </div>

    <div @click="click_chuanzhi">点击父类传值给子类</div>
    <!--选择客户-->
    <!--创建列表-->
    <!--添加按钮 关闭按钮-->
  </div>
</template>

<script setup>

import {onMounted, ref} from "vue";
import {showToast} from "vant";
import zj_list from "@/views/a_shy/zj_list.vue"

const show1 = ref(false);
const show2 = ref(false);
const actions = ref([]);
const test33 = ref("")

const onSelect = (item) => {
  // 默认情况下点击选项时不会自动收起
  // 可以通过 close-on-click-action 属性开启自动收起
  show1.value = false;
  show2.value = false;
  // showToast(item.name);
};
onMounted(() => {
  let aaa = [];
  for (let i = 0; i < 100; i++) {
    let item = {"name": i};
    aaa[i] = item;
  }
  actions.value = aaa;
})
function click_chuanzhi(){
  test33.value = "13asda爱迪生";
}

function getaaa(str){
  console.log(str)
}
</script>

<style>
.chuku_main {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.sheet_view {
  width: 100%;
  height: 3rem;
  display: flex;
  flex-direction: row;
}

.sheet_t {
  width: 5rem;
  height: auto;
}

.sheet_v {
  width: 0;
  height: auto;
  flex: 1;
}
.zj_list{
  width: 100%;
  height: 0;
  flex: 1;
  overflow: hidden;
}
</style>